package datalayer.abstractFactory;

import datalayer.abstractFactory.TestDAOFactory;
import datalayer.interfaces.IDAOAfdeling;
import datalayer.interfaces.IDAOBedrijf;
import datalayer.interfaces.IDAOWerknemer;
import datalayer.mysql.MysqlDAO;

//Auteur: Kristian
//Datum: 17-3-2015

public abstract class DAOFactory {

	public abstract IDAOAfdeling GetDAOAfdeling();

	public abstract IDAOBedrijf GetDAOBedrijf();

	public abstract IDAOWerknemer getDAOWerknemer();

	public static int SQL = 0;
	public static int test = 1;

	private static DAOFactory theFactory = null;

	public static void setFactory(int protocol) {
		switch (protocol) {
		case 0:
			theFactory = MysqlDAO.getInstance();
			break;
		case 1:
			theFactory = TestDAOFactory.getInstance();
			break;
		default:
			theFactory = null;
			break;
		}

	}

	public static DAOFactory getFactory() {
		return theFactory;
	}

}
